package com.booking.springrestful.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 来访者的预约表
 * @TableName appointments
 */
@TableName(value ="appointments")
@Data
public class Appointments implements Serializable {
    /**
     * 唯一标识预约记录
     */
    @TableId(type = IdType.AUTO)
    private Integer appointmentid;

    /**
     * 预约具体信息id
     */
    private Integer scheduleid;

    /**
     * 客户ID
     */
    private Integer userid;

    /**
     * 咨询师ID
     */
    private Integer counselorid;

    /**
     * 预约时间
     */
    private Date appointmenttime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态
     */
    private Object status;

    /**
     * 创建时间
     */
    private Date createdat;

    /**
     * 更新时间
     */
    private Date updatedat;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Appointments other = (Appointments) that;
        return (this.getAppointmentid() == null ? other.getAppointmentid() == null : this.getAppointmentid().equals(other.getAppointmentid()))
            && (this.getScheduleid() == null ? other.getScheduleid() == null : this.getScheduleid().equals(other.getScheduleid()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getCounselorid() == null ? other.getCounselorid() == null : this.getCounselorid().equals(other.getCounselorid()))
            && (this.getAppointmenttime() == null ? other.getAppointmenttime() == null : this.getAppointmenttime().equals(other.getAppointmenttime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedat() == null ? other.getCreatedat() == null : this.getCreatedat().equals(other.getCreatedat()))
            && (this.getUpdatedat() == null ? other.getUpdatedat() == null : this.getUpdatedat().equals(other.getUpdatedat()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAppointmentid() == null) ? 0 : getAppointmentid().hashCode());
        result = prime * result + ((getScheduleid() == null) ? 0 : getScheduleid().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getCounselorid() == null) ? 0 : getCounselorid().hashCode());
        result = prime * result + ((getAppointmenttime() == null) ? 0 : getAppointmenttime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedat() == null) ? 0 : getCreatedat().hashCode());
        result = prime * result + ((getUpdatedat() == null) ? 0 : getUpdatedat().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", appointmentid=").append(appointmentid);
        sb.append(", scheduleid=").append(scheduleid);
        sb.append(", userid=").append(userid);
        sb.append(", counselorid=").append(counselorid);
        sb.append(", appointmenttime=").append(appointmenttime);
        sb.append(", remark=").append(remark);
        sb.append(", status=").append(status);
        sb.append(", createdat=").append(createdat);
        sb.append(", updatedat=").append(updatedat);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}